package com.daoeping.service.impl;

import java.util.List;
import com.daoeping.dao.JobDao;
import com.daoeping.domain.Bzn_jobdescription;
import com.daoeping.domain.JsonData;
import com.daoeping.domain.Page;
import com.daoeping.domain.TableData;
import com.daoeping.service.JobService;

public class JobServiceImpl implements JobService {
	private JobDao jobDao;

	public JobDao getJobDao() {
		return jobDao;
	}

	public void setJobDao(JobDao jobDao) {
		this.jobDao = jobDao;
	}

	@Override
	public JsonData pageBzn_jobdescriptionsJson(Page page, TableData tableData, Bzn_jobdescription bzn_jobdescription) {
		return jobDao.pageBzn_jobdescriptions(page, tableData, bzn_jobdescription);
	}

	@SuppressWarnings("unchecked")
	@Override
	public Bzn_jobdescription findBzn_jobdescriptionDetail(
			Bzn_jobdescription bzn_jobdescription) {
		return ((List<Bzn_jobdescription>)jobDao.selectDataByHQL( " from Bzn_jobdescription where id =  '" + bzn_jobdescription.getId() + "'")).get(0);
	}

	@Override
	public boolean addBzn_jobdescriptionDetail(Bzn_jobdescription bzn_jobdescription) {
		if(jobDao.insertData(bzn_jobdescription)){
			return true;
		}else{
			return false;
		}
	}

	@Override
	public boolean modifyBzn_jobdescriptionDetail(
			Bzn_jobdescription bzn_jobdescription) {
		if(jobDao.insertData(bzn_jobdescription)){
			return true;
		}else{
			return false;
		}
	}

	@Override
	public JsonData findBzn_jobdescriptionDetailForModifyJson(Bzn_jobdescription bzn_jobdescription) {
		return jobDao.findBzn_jobdescriptionDetailForModify(bzn_jobdescription);
	}

}
